home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODFDev / ODF / Framewrk / FWPart / FWIdle.h < prev    next >
Encoding:
Text File  |  1996-09-17  |  2.5 KB  |  95 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                FWIdle.h
  4. //    Release Version:    $ ODF 2 $
  5. //
  6. //    Copyright:            (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #ifndef FWIDLE_H
  11. #define FWIDLE_H
  12.  
  13. // ----- Foundation Includes -----
  14.  
  15. #ifndef FWRUNTYP_H
  16. #include "FWRunTyp.h"
  17. #endif
  18.  
  19. #ifndef FWEXCLIB_H
  20. #include "FWExcLib.h"
  21. #endif
  22.  
  23. #ifndef FWSTDDEF_H
  24. #include "FWStdDef.h"
  25. #endif
  26.  
  27. // ----- OpenDoc Includes -----
  28.  
  29. #ifndef FWODTYPS_H
  30. #include "FWODTyps.h"
  31. #endif
  32.  
  33. //========================================================================================
  34. //    Forward Declarations
  35. //========================================================================================
  36.  
  37. class FW_CPart;
  38. class FW_CFrame;
  39. class ODFrame;
  40.  
  41. //========================================================================================
  42. // class FW_CIdler
  43. //========================================================================================
  44.  
  45. class FW_CIdler
  46. {
  47. public:
  48.     FW_DECLARE_AUTO(FW_CIdler)
  49.     
  50. //----------------------------------------------------------------------------------------
  51. //    Initialization/Destruction
  52. //
  53. public:
  54.     FW_CIdler(FW_CPart* part, ODIdleFrequency frequency);
  55.     FW_CIdler(FW_CFrame* frame, ODIdleFrequency frequency);
  56.     ~FW_CIdler();
  57.  
  58. //----------------------------------------------------------------------------------------
  59. //    API
  60. //
  61. public:
  62.     void                 SetIdleFrequency(Environment *ev, ODIdleFrequency frequency);
  63.     FW_Boolean            IsRegistered(Environment *ev) const;
  64.  
  65.     void                 RegisterIdle(Environment *ev, FW_Boolean state);
  66.     void                 RegisterIdle(Environment *ev);
  67.     void                 UnregisterIdle(Environment *ev);
  68.  
  69. private:
  70.     ODFrame*            PrivGetRegisteredFrame(Environment *ev) const;
  71.     
  72. //----------------------------------------------------------------------------------------
  73. //    Data Members
  74. //
  75. private:
  76.     FW_Boolean        fRegistered;
  77.     ODIdleFrequency    fFrequency;
  78.     FW_CPart*        fPart;
  79.     FW_CFrame*        fFrame;
  80. };
  81.  
  82. //========================================================================================
  83. //     inlines
  84. //========================================================================================
  85.  
  86. //----------------------------------------------------------------------------------------
  87. //    FW_CIdler::IsRegistered
  88. //----------------------------------------------------------------------------------------
  89.  
  90. inline FW_Boolean FW_CIdler::IsRegistered(Environment*) const
  91. {
  92.     return fRegistered;
  93. }
  94.  
  95. #endif